package com.example.makerspace;

import com.example.makerspace.utils.ValidateCodeUtils;

public class encrypt {
    public static String phoneSecrecy(String phoneNum){
            if(phoneNum.length() > 8){
                phoneNum = phoneNum.substring(0, 3) + "****" + phoneNum.substring(7, phoneNum.length());
            }else{
                phoneNum = phoneNum.substring(0,3) + "****";
            }
        return phoneNum;
    }

    public static String  makeSerialNumber(String category,Integer size){
        String sid = ValidateCodeUtils.fillString(size, 3);
        String serialNumber="";
        if(category.equals("人工智能")){
            serialNumber="RG";
        }
        else  if(category.equals("机器人")){
            serialNumber="JQR";
        }
        else if(category.equals("大数据")){
            serialNumber="SJ";
        }
        else if(category.equals("智能设备")){
            serialNumber="ZN";
        }
        else if(category.equals("通信工程")){
            serialNumber="TX";
        }
        else if(category.equals("系统软件")){
            serialNumber="XT";
        }
        else if(category.equals("移动应用")){
            serialNumber="YD";
        }
        else if(category.equals("其他")){
            serialNumber="QT";
        }
        serialNumber=serialNumber+"-"+sid;

        return  serialNumber;
    }
    public static void main(String[] args) {
//        String s = phoneSecrecy("产品远程验收监控系统");
//        System.out.println(s);
        String s = makeSerialNumber("人工智能", 30);
        System.out.println(s);
    }
}
